package com.hongye.model;

import java.util.List;

import com.hongye.util.Utils;
import com.jfinal.plugin.activerecord.Model;

public class AdminUser extends Model<AdminUser> {
	
	private static final long serialVersionUID = 3542073346476654160L;
	
    public static final AdminUser dao=new AdminUser();
	
	/**
	 * 验证登录用户
	 * @param userid
	 * @param passwd
	 * @return
	 */
	public boolean chkUser(String userid,String passwd){
		String sql="select * from admin where username=? and password=?";
		boolean flag=false;
		String pass=Utils.strToMD5(passwd);
		
		List<AdminUser> list=AdminUser.dao.find(sql, userid,pass);
		System.out.println(list+"  "+userid+"  "+pass);
		if (list.size()>0) {
			flag=true;
		}
		return flag;

}
}
